//
//  NewsImageCollectionViewCell.m
//  Movie
//
//  Created by mycomputer on 15/7/23.
//  Copyright (c) 2015年 杨韦智. All rights reserved.
//

#import "NewsImageCollectionViewCell.h"
#import "UIImageView+WebCache.h"

@implementation NewsImageCollectionViewCell

- (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self _createSubViews];
    }
    return self;
}

- (void)_createSubViews {
    _imageView = [[UIImageView alloc] initWithFrame:self.bounds];
    
    _imageView.layer.cornerRadius = 10;
    _imageView.layer.borderWidth = 1;
    _imageView.layer.borderColor = [UIColor whiteColor].CGColor;
    _imageView.layer.masksToBounds = YES;
    
    [self addSubview:_imageView];
}

- (void)setModel:(NewsImageModel *)model {
    _model = model;
    [self setNeedsLayout];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    NSURL *url = [NSURL URLWithString:_model.image];
    [_imageView sd_setImageWithURL:url];
    
    
}

@end
